//route 访问路径，路由
//router 路由管理者
import { createRouter, createWebHashHistory } from 'vue-router';// 创建路由实例并传递 `routes` 配置const router = createRouter({// 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
//创建路由 route





import Flex from "@/views/testpage/Flex.vue"
import Fl from "@/views/testpage/Fl.vue"
import Axios from "@/views/testpage/Axios.vue"
import Reg from "@/views/users/Reg.vue"
import UserInfo from "@/views/users/UserInfo.vue"
import Login from "@/views/users/Login.vue"

import articleDetail from '@/views/article/articleDetail.vue'

import article from '@/views/article/article.vue'


import Test from "@/views/testpage/Test.vue"
import NotFoundComponent from "@/views/NotFoundComponent.vue"

const routes = [
   {
      path: '/',
      redirect: { name: 'login' },
    },
   { path: '/flex', component: Flex },
   { path: '/fl', component: Fl },
   { path: '/test', component: Test },
   { path: '/axios', component: Axios },

   { path: '/userinfo', component: UserInfo },
   { path: '/login',name:"login", component: Login },
   { path: '/reg', component: Reg },

   { path: '/articleDetail', component: articleDetail },
   { path: '/article/:id', component: article },
   {
      path: '/:catchAll(.*)',
      component: NotFoundComponent
    }
    
   

]
//创建路由管理 router
const router = createRouter({// 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
   history: createWebHashHistory(),
   routes,
}
);
//导出路由
export default router